<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php
 @session_start();

/*   Description  of this file
 *    Author king-of-war
 *    Last Modified 2009-5-8
 *    This class designed  for the vote operation
 */
 // which  votes will dispaly
$id=6;


/*
 * vote display begin
 */

$root_path = '../';


include_once $root_path . 'admin/class/vote.class.php';

/*
 *
 * check identify
 */

include_once $root_path.'admin/class/verify.class.php';
$a=new verify($root_path);
$a->identity_check(2);



$vote = new vote($root_path);
/*
 * get the topic &^&  all seclect num
 */
$pass=$vote->vote_read($id,1);
if(!$pass){
echo  '无主题';
exit;
}
$topic=$pass[0]->get_topic();

$bb=$vote->vote_display($id,1);

$title=$topic;

$items=array();

for($i=0;$i<count($bb);$i++){
$items['name'][$i]=$bb[$i]['contant'];
 $items['date'][$i]=0;
}

$votes=$vote->vote_display($id,0);

$total=count($votes);

for($i=0;$i<$total;$i++){
 $a=$votes[$i];
 $items['date'][$a-1]+=1;
}



/*
 * set display
 */
require_once $root_path.'includes/xml/xml_op.php';

$xml=new xml_op($root_path);

$xml->xml_vote('includes/xml/piedata.xml',$title,$items);



/*
*  set templates
*/

?>

